layui.use(['laydate','form','upload'], function(){
    var laydate = layui.laydate;
    var form = layui.form;
    var layer = layui.layer;

    /*点击提交*/
    form.on('submit(baocun)',function(data) {
        let edit_url = window.location.href;
        $.post(edit_url,data.field,function(msg){
            if(msg.code === 1){
                layer.msg(msg.msg, {icon: 6, time: 1000}, function(){
                    /*刷新当前页*/
                    xadmin.close()
                    /*重载父级表格*/
                    parent.layui.tableObj.reload();
                })
            }else{
                layer.msg(msg.msg, {icon: 2, time: 2000})
            }
        })
        return false;
    })

})